/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <gtest/gtest.h>
#include "sle_host_interface.h"
#include "kh_sle_host.h"
#include "cmd_input.h"
#include <vector>
#include <memory>
#include <cstring>
#include <iterator>
#include <string.h>


namespace OHOS {
namespace NearLink {
namespace SleStandard {
namespace {
using namespace testing::ext;
} // namespace

class HostHandlerTest : public testing::Test {
public:
    static void SetUpTestCase();
    static void TearDownTestCase();
    void SetUp();
    void TearDown();
};

void HostHandlerTest::SetUpTestCase() {}

void HostHandlerTest::TearDownTestCase() {}

void HostHandlerTest::SetUp() {
    SleErrorCode ret = InitSleHostService();
    if(ret != SLE_NO_ERROR)
    printf("ret = %d", ret);
}

void HostHandlerTest::TearDown() {}

HWTEST_F(HostHandlerTest, SleEnableTest, TestSize.Level1)
{
    SleErrorCode ret = SleEnable();
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}

HWTEST_F(HostHandlerTest, SleDisableTest, TestSize.Level1)
{
    SleErrorCode ret = SleDisable();
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}

HWTEST_F(HostHandlerTest, GetSleStateTest, TestSize.Level1)
{
    SleDeviceState sleHostState;
    SleErrorCode ret = GetSleState(&sleHostState);
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}

HWTEST_F(HostHandlerTest, GetHostAddressTest, TestSize.Level1)
{
    SleDeviceAddress hostAddr;
    hostAddr.addrType = SLE_PUBLIC_ADDRESS_TYPE;
    SleErrorCode ret = GetHostAddress(&hostAddr);
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}

HWTEST_F(HostHandlerTest, SetHostNameTest, TestSize.Level1)
{
    char name[SLE_DEVICE_NAME_LEN + 1];
    std::string name_s = "test";
    strcpy(name, name_s.c_str());
    SleErrorCode ret = SetHostName((uint8_t*)name, strlen(name));
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}

HWTEST_F(HostHandlerTest, GetHostNameTest, TestSize.Level1)
{
    uint8_t name[SLE_DEVICE_NAME_LEN];
    uint8_t nameLen = SLE_DEVICE_NAME_LEN;
    SleErrorCode ret = GetHostName(name, &nameLen);
    (void)ret;
    // EXPECT_EQ(ret, SLE_ERR_IPC_TRANS_FAILED);
}
}
} // namespace NetManagerStandard
} // namespace OHOS